Stored Procedures [dbo].[dt_setpropertybyid]
Properties
PropertyValue
ANSI Nulls OnYes
Quoted Identifier OnYes
Parameters
NameData TypeMax Length (Bytes)
@idint4
@propertyvarchar(64)64
@valuevarchar(255)255
@lvalueimage16
Permissions
TypeActionOwning Principal
GrantExecutepublic
SQL Script
/*
**    If the property already exists, reset the value; otherwise add property
**        id -- the id in sysobjects of the object
**        property -- the name of the property
**        value -- the text value of the property
**        lvalue -- the binary value of the property (image)
*/

create procedure dbo.dt_setpropertybyid
    @id int,
    @property varchar(64),
    @value varchar(255),
    @lvalue image
as
    set nocount on
    declare @uvalue nvarchar(255)
    set @uvalue = convert(nvarchar(255), @value)
    if exists (select * from dbo.dtproperties
            where objectid=@id and property=@property)
    begin
        --
        -- bump the version count for this row as we update it
        --
        update dbo.dtproperties set value=@value, uvalue=@uvalue, lvalue=@lvalue, version=version+1
            where objectid=@id and property=@property
    end
    else
    begin
        --
        -- version count is auto-set to 0 on initial insert
        --
        insert dbo.dtproperties (property, objectid, value, uvalue, lvalue)
            values (@property, @id, @value, @uvalue, @lvalue)
    end
GO
GRANT EXECUTE ON  [dbo].[dt_setpropertybyid] TO [public]
GO
Uses
Used By